<meta charset="UTF-8">
<script>

    var word = ["America","Greece","Britain","Canada","China","Egypt"];

    document.write(word)

    var count = 0;

    for(var i = 0;i<word.length;i++){
        if (word[i].indexOf("a")>=0||word[i].indexOf("A")>=0){
            count++;
        }
    }
    alert("A|a一共出现在"+count+"个字符串中")


</script>